package io.demo.command;

/**
 * @author create by zhangpengfei at 2021/9/29 20:01
 */

public class GarageDoorCloseCommand implements Command{

    GarageDoor garageDoor;

    public GarageDoorCloseCommand(GarageDoor garageDoor) {
        this.garageDoor = garageDoor;
    }

    @Override
    public void execute() {
        garageDoor.off();
    }

    @Override
    public void undo() {
        garageDoor.on();
    }
}
